package com.cssnj.portal.service.api;

import com.cssnj.portal.domain.common.UserInfo;
import io.predictech.framework.domain.api.RestResponse;
import io.predictech.framework.service.facade.RestfulAPI;
import io.predictech.framework.utility.StringUtil;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Service;

/**
 * @Auther: yangxi
 * @Date: 2018/9/14 13:11
 * @Description:
 */
@Service("restfulAPI")
public class RestfulUser extends RestfulAPI {
    @Override
    public RestResponse getUserInfo() {
        RestResponse portalResponse = new RestResponse();
        UserInfo userInfo = (UserInfo) SecurityUtils.getSubject().getPrincipal();
        portalResponse.getRespData().put("dlzhDm", StringUtil.empty(userInfo.getDlzhDm())); //登录账号代码
        portalResponse.getRespData().put("swryDm", StringUtil.empty(userInfo.getSwryDm())); //税务人员代码,
        portalResponse.getRespData().put("swryXm", StringUtil.empty(userInfo.getSwryXm())); //税务人员姓名,
        portalResponse.getRespData().put("swrySfDm", StringUtil.empty(userInfo.getSwrySfDm())); //税务人员身份代码,
        portalResponse.getRespData().put("sfswJgDmDz", StringUtil.empty(userInfo.getSfswJgDmDz())); //税务人员身份对照代码,
        portalResponse.getRespData().put("swryDmDz", StringUtil.empty(userInfo.getSwryDmDz())); //税务人员代码国地税对照,
        portalResponse.getRespData().put("swrySfMc", StringUtil.empty(userInfo.getSwrySfMc())); //税务人员身份名称,
        portalResponse.getRespData().put("sfswJgDm", StringUtil.empty(userInfo.getSfswJgDm())); //身份税务机关代码,
        portalResponse.getRespData().put("sfswJgMc", StringUtil.empty(userInfo.getSfswJgMc())); //身份税务机关名称,
        portalResponse.getRespData().put("gwlist", StringUtil.empty(userInfo.getGwlist())); //岗位
        return portalResponse;
    }
}
